<%@ page import="com.goal98.team.Constants" %>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main"/>
    <title>${teamInstance}<g:message code="info.pendingTask" default="Pending Task"/></title>
  </head>
  <body>

    <div class="body">
      <h1>${teamInstance}<g:message code="info.pendingTask" default="Pending Task"/></h1>
      <g:if test="${flash.message}">
        <div class="message"><g:message code="${flash.message}" args="${flash.args}" default="${flash.defaultMessage}"/></div>
      </g:if>

      <g:if test="${upcomingActivity}">

        <div class="dialog" style="float:left; width:800px;  margin:3px;">

          <style type="text/css">
          .name {
            font-size: 16px;
          }

          .value {
            font-size: 16px;
            font-weight: bold;
          }
          </style>

          <table>
            <tbody>
              <tr class="prop">
                <td colspan="2"><h1><g:message code="info.pendingTask.upcoming.activity" default="Upcoming Activity"/></h1></td>
                <td rowspan="4">
                  <g:if test="${upcomingActivity?.venue}">
                    <resource:map key="ABQIAAAACcCM2DMxzv4n939Jgm34YxQ3LG4vAN-CueICCIjDKaxRKN2F1xQ1y-xVQPy1hfM8M8zYmFIZ-jUyxw"/>
                    <div style="margin:4px 0px;border:1px solid #ccc;padding:5px;">
                      <richui:map lat="${upcomingActivity?.venue?.lat}" lng="${upcomingActivity?.venue?.lng}"/>
                    </div>
                  </g:if>
                </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name" colspan="2">
                  <g:link controller="teamActivity" action="show" id="${upcomingActivity?.id}">
                    <g:message code="button.click.detail" default="Click for Details."/>
                  </g:link>
                </td>

              </tr>

              <tr class="prop">
                <td valign="top" class="name"><g:message code="activity.activityTime" default="Activity Time"/>:</td>

                <td valign="top" class="value"><g:formatDate date="${upcomingActivity?.activityTime}" format="yyyy-MM-dd HH:mm"/></td>

              </tr>

              <tr class="prop">
                <td valign="top" class="name"><g:message code="activity.venue" default="Venue"/>:</td>

                <td valign="top" class="value">

                  <g:link controller="venue" action="show" id="${upcomingActivity?.venue?.id}">
                    ${upcomingActivity?.venue?.encodeAsHTML()}
                  </g:link>

                </td>

              </tr>

            </tbody>
          </table>

        </div>

      </g:if>

      <div style="clear:both;"></div>

      <g:ifAnyGranted role="${Constants.ROLE_TEAM_ADMIN}">

        <div class="dialog" style="float:left; width:497px; margin:3px;">

          <table>
            <tbody>
              <tr>
                <td><h1><g:message code="info.pendingTask.activity" default="Pending Activity"/></h1></td>
              </tr>
              <g:each var="activity" in="${activityList}">
                <tr>
                  <td>
                    <g:link controller="teamActivity" action="show" id="${activity.id}">${activity}</g:link>
                  </td>
                </tr>
              </g:each>
            </tbody>
          </table>

        </div>

        <div class="dialog" style="float:left; width:297px; margin:3px;">

          <table>
            <tbody>
              <tr>
                <td><h1><g:message code="info.pendingTask.member" default="Pending member"/></h1></td>
              </tr>
              <g:each var="member" in="${memberList}">
                <tr>
                  <td>
                    <g:link controller="player" action="account" id="${member.id}">
                      ${member}:${member.account ? member.account?.balance : 0}
                    </g:link>
                  </td>
                </tr>
              </g:each>
            </tbody>
          </table>

        </div>
        <div style="clear:both;"></div>
      </g:ifAnyGranted>
    </div>

  </body>
</html>
